package com.danskin.wechat.dao;

import com.danskin.wechat.entity.StoreInfo;
import com.danskin.wechat.entity.example.StoreInfoExample;
import com.danskin.wechat.util.Page;
import com.danskin.wechat.vo.StoreQrcodeScanVo;

import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface StoreInfoDao {
    int countByExample(StoreInfoExample example);

    int deleteByExample(StoreInfoExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(StoreInfo record);

    int insertSelective(StoreInfo record);

    List<StoreInfo> selectByExample(StoreInfoExample example);


	/**
	 * 去重查询所有的店铺编号
	 * 
	 * @return
	 * @author makunsmac
	 */
	List<String> selectStoreCodeList();

	/**
	 * 分页查询店铺二维码扫描记录
	 * 
	 * @param param
	 * @return
	 * @author makunsmac
	 */
	List<StoreQrcodeScanVo> listPageStoreQrcodeScan(Page page);

	/**
	 * 根据主键获取门店信息
	 * 
	 * @param id
	 * @return
	 * @author makunsmac
	 */
	StoreInfo selectByPrimaryKey(@Param("id") Integer id);
	
	StoreInfo selectByStoreCode(@Param("storeCode") String storeCode);

	/**
	 * 查询出所有符合条件的数据
	 * 
	 * @param param
	 * @return
	 * @author makunsmac
	 */
	List<StoreQrcodeScanVo> selectStoreQrcodeScanList(StoreQrcodeScanVo param);

    int updateByExampleSelective(@Param("record") StoreInfo record, @Param("example") StoreInfoExample example);

    int updateByExample(@Param("record") StoreInfo record, @Param("example") StoreInfoExample example);

    int updateByPrimaryKeySelective(StoreInfo record);

    int updateByPrimaryKey(StoreInfo record);

	List<StoreInfo> listPageStrore(Page page);
	
	int  insertBatchSelective(List<StoreInfo> list);

	List<StoreQrcodeScanVo> queryStoreQrcodeScanVoExport(@Param("storeCode")String storeCode, @Param("eventType")String eventType, @Param("startTime")String startTime,
			@Param("endTime")String endTime, @Param("mpId")String mpId);
}